package com.icss;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

import java.util.stream.Stream;

@SpringBootApplication
@MapperScan(basePackages = "com.icss.dao")
public class MySpringbootApp implements CommandLineRunner {
    public static void main(String[] args) {

        SpringApplication.run(MySpringbootApp.class, args);
    }

    @Autowired
    ApplicationContext context;
    @Override
    public void run(String... args) throws Exception {
//        System.out.println(context);
//        Stream.of(context.getBeanDefinitionNames()).forEach(item -> {
//            System.out.println("name:" + item + "类：" + context.getBean(item).getClass());
//        });
    }
}